<?php

namespace Portal\LessonBundle\Form;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;

class LessonType extends AbstractType
{
//  private $subjectCategory;
//  private $subject;
//  
//  public function __construct($subjectCategory, $subject)
//    {
//      $this->subjectCategory;
//      $this->subject;
//    }


    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder
            ->add('subjectCategory', 'entity', array('class' => 'Portal\LessonBundle\Entity\subjectCategory', 'property' => 'name', 'empty_value' => 'Сонгох', 'empty_data' => null))
            ->add('subject', 'entity', array('class' => 'Portal\LessonBundle\Entity\Subject', 'property' => 'name', 'empty_value' => 'Сонгох', 'empty_data' => null))
            ->add('startDate', 'date')
            ->add('endDate', 'date')
            ->add('address', 'textarea')
            ->add('totalHours', 'text')
            ->add('hourlyFee', 'text')            
            ->add('address', 'textarea')
            ->add('description', 'textarea')            
        ;
    }

    public function setDefaultOptions(OptionsResolverInterface $resolver)
    {
        $resolver->setDefaults(array(
            'data_class' => 'Portal\LessonBundle\Entity\Lesson'
        ));
    }

    public function getName()
    {
        return 'portal_lessonbundle_lessontype';
    }
}
